import React from "react";
import Footer from "../pages/footer/Footer";
import Heaser from "../pages/header/header";
import Midden from "../pages/Midden/midden";
export default class Homes extends React.Component {

    state = {
        minddens: [
            { title: "html", degree: "精通", bol: false },
            { title: "css", degree: "精通", bol: false },
            { title: "js", degree: "精通", bol: false },
            { title: "react", degree: "精通", bol: false },
            { title: "vue2", degree: "精通", bol: false },
            { title: "vue3", degree: "精通", bol: false },
            { title: "wechat", degree: "精通", bol: false },
        ],
        num:1000

    }
    fn = (i) => {
        return () => {

            let newarr = this.state.minddens.map((iteam, index) => {
                if (index === i) {
                    this.state.minddens[i].bol = !this.state.minddens[i].bol
                }
                return iteam
            })
            this.setState({
                minddens: newarr
            })
        }
    }
    render() {
        let { minddens, num, fn } = this.state
        return <div>


            <Heaser></Heaser>
            <Midden {...this.state} fn={this.fn} ></Midden>
            <Footer></Footer>
        </div>
    }

}